fix(ai-skills): exclude non-speckit copilot agent markdown from skill…#1867
fix(ai-skills): exclude non-speckit copilot agent markdown from skill…#1867darkglow-net wants to merge 5 commits intogithub:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Fixes #1858 by preventing install_ai_skills() from generating skills from non–spec-kit GitHub Copilot agent markdown files that may coexist in .github/agents/.
Changes:
- Update
install_ai_skills()to filter Copilot templates tospeckit.*.md. - Update the all-agents skills installation test to respect
commands_subdirand adjust Copilot’s template filename. - Add a new test ensuring non-speckit Copilot agent markdown files are ignored during skill generation.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds Copilot-specific template globbing to avoid converting unrelated .md files into skills. |
tests/test_ai_skills.py |
Updates fixture setup to follow commands_subdir and adds coverage for ignoring non-speckit Copilot agent files. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
src/specify_cli/__init__.py
Outdated
| if selected_ai == "copilot": | ||
| command_files = sorted(templates_dir.glob("speckit.*.md")) | ||
| else: | ||
| command_files = sorted(templates_dir.glob("*.md")) |
tests/test_ai_skills.py
Outdated
| (agents_dir / "speckit.plan.md").write_text( | ||
| "---\ndescription: Generate implementation plan.\n---\n\n# Plan\n\nBody.\n" | ||
| ) | ||
| (agents_dir / "other-agent.agent.md").write_text( | ||
| "---\ndescription: Some other agent\n---\n\n# Other\n\nBody.\n" | ||
| ) |
mnriem
left a comment
There was a problem hiding this comment.
Please address Copilot feedback. If not applicable please explain why
Fix missing `.agent` filename suffix Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Fixes issue #1858 where install_ai_skills (for --ai copilot --ai-skills) incorrectly converts non–spec-kit Markdown files in .github/agents/ into generated skills.
Changes:
- Filter Copilot command templates during skill installation to only include
speckit.*.mdfiles. - Update the “all agents” skills install test to respect
commands_subdirand add a Copilot-specific regression test to ignore non-speckit agent Markdown.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds Copilot-only template glob filtering (speckit.*.md) during skill generation. |
tests/test_ai_skills.py |
Updates multi-agent install test to use commands_subdir; adds regression test ensuring non-speckit Copilot agent Markdown doesn’t generate skills. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Copilot uses speckit.*.agent.md templates; other agents use plain names | ||
| fname = "speckit.specify.agent.md" if agent_key == "copilot" else "specify.md" |
tests/test_ai_skills.py
Outdated
| (agents_dir / "speckit.plan.md").write_text( | ||
| "---\ndescription: Generate implementation plan.\n---\n\n# Plan\n\nBody.\n" | ||
| ) | ||
| (agents_dir / "other-agent.agent.md").write_text( | ||
| "---\ndescription: Some other agent\n---\n\n# Other\n\nBody.\n" | ||
| ) |
src/specify_cli/__init__.py
Outdated
|
|
||
| command_files = sorted(templates_dir.glob("*.md")) | ||
| if selected_ai == "copilot": | ||
| command_files = sorted(templates_dir.glob("speckit.*.md")) |
Fix test assertion speckit.plan.md to speckit.plan.agent
There was a problem hiding this comment.
Pull request overview
Fixes issue #1858 where install_ai_skills incorrectly generated skills from user-authored (non–spec-kit) Copilot agent markdown files under .github/agents/.
Changes:
- Filter Copilot skill generation inputs to
speckit.*.mdtemplates only. - Update the cross-agent skills installation test to respect each agent’s
commands_subdir. - Add a regression test ensuring non-
speckit.*Copilot agent markdown files are ignored.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
src/specify_cli/__init__.py |
Adds Copilot-specific glob filtering so only speckit.*.md templates in .github/agents/ are considered for skill generation. |
tests/test_ai_skills.py |
Updates the parametrized test to use commands_subdir and adds a Copilot regression test for ignoring non-speckit agent markdown. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # Copilot uses speckit.*.agent.md templates; other agents use plain names | ||
| fname = "speckit.specify.agent.md" if agent_key == "copilot" else "specify.md" | ||
| (cmds_dir / fname).write_text( |
| skills_dir = project_dir / ".github" / "skills" | ||
| assert skills_dir.exists() | ||
| skill_dirs = [d.name for d in skills_dir.iterdir() if d.is_dir()] | ||
| assert "speckit-plan" in skill_dirs |
src/specify_cli/__init__.py
Outdated
| if selected_ai == "copilot": | ||
| command_files = sorted(templates_dir.glob("speckit.*.md")) | ||
| else: | ||
| command_files = sorted(templates_dir.glob("*.md")) |
fix(ai-skills): normalize Copilot .agent template names and align template fallback filtering
Description
Fix issue #1858 -
install_ai_skillscreates spurious skills from non-speckit agent files when using--ai copilot --ai-skillsFix:
install_ai_skills()now filters copilot command templates tospeckit.*.md- preventing user-authored agent files in agents from being incorrectly converted into skills.Other agents are unaffected since their
commands_subdirdirectories contain only speckit templates.Test: Adds
test_copilot_ignores_non_speckit_agentsto verify that non-speckit markdown files (e.g.other-agent.agent.md) in the shared agents directory are excluded from skill generation.Testing
.github/agents/specify init --ai copilot --ai-skills --here.github/skills/AI Disclosure
RCA and remediation developed with Github Copilot. Code review conducted with Opus 4.6.